<template>
  <div class="box" @click="toFilmDetail(film.filmId)">
    <div class="picture">
       <!-- v-lazy 为指令，指令中属性值为js环境 -->
      <img v-lazy="film.poster" alt="" />
    </div>
    <div class="content-wapper">
      <div class="title">
        <div class="title-l">{{ film.name }}</div>
      </div>
      <div class="score">
        <div class="score-l">观众评</div>
        <div class="score-r">{{ film.grade || 10 }}</div>
      </div>
      <div class="actor">
          {{ film.actors | actorToStr }}
      </div>
      <div class="show">今天211家影院播放</div>
    </div>
    <div class="buy">购票</div>
  </div>
</template>

<script>
// import Vue from 'vue'
// import VueLazyload from 'vue-lazyload'
// Vue.use(VueLazyload, {
//     loading: "https://2url.cc/1OwrB",
//     error:"https://2url.cc/1OwrB",
// });
export default {
  data() {
    return {
      src:"https://p0.meituan.net/moviemachine/d53bf06943eeaa6b04e53a4a720818ec13780243.jpg@1l_1e_1c_128w_180h"
    };
  },
  props: {
    film: Object,
  },
  mounted() {},
  methods: {
    toFilmDetail(id) {
      this.$router.push({
        name: "filmDetail",
        params: { id },
      });
    },
  },
};
</script>


<style lang='scss' scoped>
.box {
  width: 100%;
  height: 114px;
  border-bottom: 1px solid #ccc;
  position: relative;
  .picture {
    width: 64px;
    height: 90px;
    float: left;
    margin: 10px 0 0 10px;
    img{
        width: 100%;
        height: 100%;
    }
  }
  .content-wapper {
    width: 207px;
    height: 88px;
    margin: 10px 0 0 10px;
    float: left;
    .title {
      width: 207px;
      height: 24px;
      margin-bottom: 6px;
      line-height: 24px;
      overflow: hidden;
      .title-l {
        font-size: 17px;
        color: #333;
        font-weight: 700;
        padding-right: 5px;
        flex-shrink: 1;
      }
    }
    .score {
      width: 207px;
      height: 15px;
      line-height: 15px;
       margin-bottom: 3px;
      .score-l {
        font-size: 13px;
        color: #666;
        float: left;
      }
      .score-r {
        font-weight: 700;
        color: #faaf00;
        font-size: 15px;
        float: left;
        padding-left: 10px;
      }
       }
      .actor {
        width: 207px;
        font-size: 13px;
        color: #666;
        height: 15px;
        line-height: 15px;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
        margin-bottom: 3px;
      }
      .show{
          width: 207px;
              font-size: 13px;
    color: #666;
      }
   
  }
  .buy {
    width: 47px;
    height: 27px;
    line-height: 28px;
    text-align: center;
    background-color: #f03d37;
    color: #fff;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 12px;
    cursor: pointer;
    position: absolute;
    top: 45px;
    right: 15px;
  }
  &:last-child{
  padding-bottom:50px;
}
}

</style>
